/**
 * 
 */
package edu.gtcfla.km.platform.appmodules.web;

import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.authz.annotation.RequiresUser;
import org.apache.shiro.subject.PrincipalCollection;
import org.apache.shiro.subject.Subject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;
import org.vsg.security.annotation.RegisterRequestPermissionStrategy;

/**
 * @author Bill Vison
 *
 */
@Controller
@RequestMapping("/apps_crm")
public class MyCFSController {

	private final static Logger logger = LoggerFactory.getLogger(MyCFSController.class);
	
	private String modulePrefix = "/apps_crm/mycfs";

	@RequiresUser
	@RequestMapping(value = "/mycfs/myhome.htm")
	public ModelAndView myhome(HttpServletRequest req, HttpServletResponse res)
			throws Exception {

		ServletContext servletContext = req.getSession().getServletContext();


		ModelAndView mav = new ModelAndView();
		mav.setViewName( modulePrefix + "/mycfs"); // view name
		

		return mav;
	}	

	
	@RequiresUser
	@RegisterRequestPermissionStrategy(
		value = "myportal.htm",
		skipCheck = true
	)
	@RequestMapping(value = "/mycfs/myportal.htm")
	public ModelAndView myportal(HttpServletRequest req, HttpServletResponse res)
			throws Exception {
		
		Subject currSubject = SecurityUtils.getSubject();
		





		ModelAndView mav = new ModelAndView();
		mav.setViewName( modulePrefix + "/myportal"); // view name
		return mav;
	}	

	@RequiresUser
	@RegisterRequestPermissionStrategy(
		value = "portal-theme.htm",
		skipCheck = true
	)
	@RequestMapping(value = "/mycfs/myportaltheme.htm")
	public ModelAndView myportalTheme(HttpServletRequest req, HttpServletResponse res)
			throws Exception {

		ServletContext servletContext = req.getSession().getServletContext();

		ModelAndView mav = new ModelAndView();
		mav.setViewName( modulePrefix + "/myportal_theme"); // view name
		return mav;
	}	


}
